package com.ccx.myinterpreter;
public class Token {
    private String lexeme;      // 词位，拥有意义的最小单位
    private TokenType type; // todo enum
    private Object literal;

    public Token() {}

    public Token(String lexeme, TokenType type, Object literal) {
        this.lexeme = lexeme;
        this.type = type;
        this.literal = literal;
    }

    public String getLexeme() {
        return lexeme;
    }

    public void setLexeme(String lexeme) {
        this.lexeme = lexeme;
    }

    public TokenType getType() {
        return type;
    }

    public void setType(TokenType type) {
        this.type = type;
    }

    public Object getLiteral() {
        return literal;
    }

    public void setLiteral(Object literal) {
        this.literal = literal;
    }

    @Override
    public String toString() {
        return "Token [lexeme=" + lexeme + ", type=" + type + ", literal=" + literal + "]";
    }

}
